package net.cctms.zhishu.webAppFramework.ui.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import net.cctms.zhishu.R;

/**
 * Created by yanfei on 2017/9/7.
 */
public class CommonDialog extends Dialog implements View.OnClickListener{

    private Context mContext;

    /**
     * 取消
     */
    private LinearLayout mCancelLayout;
    /**
     * 确认
     */
    private LinearLayout mConfirmLayout;


    /** 对话框的回调监听器 */
    private OnDialogClickListener mOnDialogClickListener;
    private String title,content,submitTxt, cancelTxt;
    private boolean showSubmit,showCancel,showTitle=false;

    public CommonDialog(@NonNull Context context,String title,String content,String submitTxt,boolean showSubmit,boolean showCancel) {
        super(context, R.style.ShowDialogStyle);
        this.mContext = context;
        this.showSubmit=showSubmit;
        this.showCancel=showCancel;
        this.submitTxt=submitTxt;
        this.content=content;
        this.title=title;
    }

    public CommonDialog(@NonNull Context context,String title,String content,String submitTxt,String cancelTxt,boolean showSubmit,boolean showCancel,boolean showTitle) {
        super(context, R.style.ShowDialogStyle);
        this.mContext = context;
        this.showSubmit=showSubmit;
        this.showCancel=showCancel;
        this.submitTxt=submitTxt;
        this.cancelTxt =cancelTxt;
        this.content=content;
        this.title=title;
        this.showTitle=showTitle;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.dialog_unsubscribe);

        initViews();
    }

    private void initViews() {

    }



    @Override
    public void onClick(View v) {

    }

    /**
     * 设置对话框的回调监听器
     *
     * @param listener
     *            对话框的回调监听器
     */
    public void setOnDialogClickListener(OnDialogClickListener listener) {
        this.mOnDialogClickListener = listener;
    }

    public interface OnDialogClickListener {

        /**
         * 确认按钮的回调方法
         *
         */
        public void onClickConfirm();

        /**
         * 取消按钮的回调方法
         */
        public void onClickCancel();

    }
}
